Component({
  data: {
    selected: 0,
    color: "#666666",
    selectedColor: "#4338CA",
    list: [{
      pagePath: "/pages/shops/list",
      iconPath: "/images/tabbar/home.png",
      selectedIconPath: "/images/tabbar/home-active.png",
      text: "生活圈"
    }, {
      pagePath: "/pages/my/my",
      iconPath: "/images/tabbar/my.png",
      selectedIconPath: "/images/tabbar/my-active.png",
      text: "我的"
    }]
  },
  attached() {
    // 获取系统信息
    wx.getSystemInfo({
      success: (res) => {
        this.setData({
          safeAreaInsetBottom: res.safeArea.bottom - res.screenHeight + 34
        })
      }
    })
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    }
  }
}) 